<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    destroyOnClose
    :visible="visible"
  >
    <zzzs-product-recording-form
      ref="realForm"
      :disabled="disableSubmit"
      :id="recordId"
      normal
    ></zzzs-product-recording-form>
    <zzzs-examine-modal
      :visible="examineVisible"
      :id="id"
      :recordId="recordId"
      :recordType="recordType"
      @ok="modalOk"
      @close="modelClose"
    ></zzzs-examine-modal>
    <div class="drawer-footer">
      <a-button @click="handleCancel" style="margin-bottom: 0">关闭</a-button>
      <a-button v-if="!disableSubmit" @click="check()" type="primary" style="margin-bottom: 0">审批</a-button>
    </div>
  </a-drawer>
</template>

<script>
import ZzzsProductRecordingForm from './ZzzsProductRecordingFormExamine'
import ZzzsExamineModal from '@/views/productForReference/modules/ZzzsExamineModal'

export default {
  name: 'ZzzsRecordEnterpriseModal',
  props: {
    visible: {
      type: Boolean,
      require: true,
    },
    recordId: {
      type: String,
      require: true,
    },
    id: {
      type: String,
      require: true,
    },
    recordType: '',
  },

  components: {
    ZzzsProductRecordingForm,
    ZzzsExamineModal,
  },
  data() {
    return {
      title: '操作',
      width: 800,
      visible: false,
      disableSubmit: false,
      examineVisible: false,
    }
  },
  created() {},
  methods: {
    modalOk() {
      this.modelClose()
      this.handleCancel()
    },
    check() {
      this.examineVisible = true
    },
    modelClose() {
      this.examineVisible = false
    },
    close() {},
    handleCancel() {
      this.$emit('close')
    },
    //获取备案信息
  },
}
</script>

<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
  margin-left: 30px;
  margin-bottom: 30px;
  float: right;
}
.drawer-footer {
  position: absolute;
  bottom: -8px;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>